package com.qzsoft.zhjd.laboratory.modules.laboratoryfurnace.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.jeemis.common.utils.Result;
import com.qzsoft.zhjd.common.utils.ResultUtils;
import com.qzsoft.zhjd.laboratory.modules.laboratoryfurnace.dto.LaboratoryFurnaceDto;
import com.qzsoft.zhjd.laboratory.modules.laboratoryfurnace.dto.LaboratoryFurnaceStatisticsDto;
import com.qzsoft.zhjd.laboratory.modules.laboratoryfurnace.service.LaboratoryFurnaceService;

/**
 * @ClassName LaboratoryFurnaceController
 * @Description 燃烧炉控制器
 * @author linhuawei
 * @since 2022-04-18
 */
@RestController
@RequestMapping("/api/laboratoryFurnace")
public class LaboratoryFurnaceController {

    @Autowired
    private LaboratoryFurnaceService laboratoryFurnaceService;

    /**
     * @Title page
     * @Description 获取分页数据
     * @param params 查询条件
     * @return 分页数据
     */
    @GetMapping("/page")
    public Result<IPage<LaboratoryFurnaceDto>> page(@RequestParam Map<String, Object> params) {
        IPage<LaboratoryFurnaceDto> page = laboratoryFurnaceService.pageDto(params);
        return ResultUtils.ok(page);
    }

    /**
     * @Title dataForStatistics
     * @Description 分析页面数据
     * @param params 查询条件
     * @return 分析页面数据
     */
    @GetMapping("/dataForStatistics")
    public Result<LaboratoryFurnaceStatisticsDto> dataForStatistics(@RequestParam Map<String, Object> params) {
        LaboratoryFurnaceStatisticsDto result = laboratoryFurnaceService.dataForStatistics(params);
        return ResultUtils.ok(result);
    }

}
